package com.gnerv.cms.dto;

import com.gnerv.cms.entity.Task;
import com.google.gson.Gson;
import lombok.Data;
import org.springframework.beans.BeanUtils;

@Data
public class TaskSaveDTO {

    private String ukId;
    private String name;
    private String content;
    private Integer type;

    private String cron;
    private Integer total;

    private Integer status;
    private Integer sort;

    public Task convert(){
        Task task = new Task();
        BeanUtils.copyProperties(this, task);
        return task;
    }

    @Override
    public String toString() {
        return new Gson().toJson(this);
    }
}
